package Servlets;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/courseEnroll")
public class courseEnroll extends HttpServlet {
	private static final long serialVersionUID = 1L;


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{
		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{
		String id = request.getParameter("studentID");
		String cName = request.getParameter("courseName");
		String cSec = request.getParameter("courseSection");
	
		System.out.println("Enroll "+id+" in "+cName+" "+cSec);
		RequestDispatcher rd=getServletContext().getRequestDispatcher("/View/enrollCourses.jsp");
		rd.forward(request, response);
	}

}
